import request from '@/utils/request';

/**
 * 根据员工名称获取员工列表
 * @param data
 * @returns
 */
export const searchWorkUserListByName = (data: any) => {
    return request({
        url: '/scrm-api/console/work/contact/work-user/search-list',
        method: 'POST',
        data,
        noNeedLoading: true
    });
};

/**
 * 按照员工查询客群数据
 * @param data
 * @returns
 */
export const getGroupChatStatisticsByWorkUser = (data: any) => {
    return request({
        url: '/scrm-api/census/groupchat-stat/woker-user/list',
        method: 'POST',
        data
    });
};

/**
 * 按照员工导出数据统计
 * @param data
 * @returns
 */
export const exportGroupChatStatisticsByWorkUser = (data: any) => {
    return request({
        url: '/scrm-api/census/groupchat-stat/woker-user/async-export',
        method: 'POST',
        data
    });
};

/**
 * 按照群聊查询客群数据
 * @param data
 * @returns
 */
export const getGroupChatStatisticsByGroupchat = (data: any) => {
    return request({
        url: '/scrm-api/census/groupchat-stat/groupchat/list',
        method: 'POST',
        data
    });
};

/**
 * 按照群聊导出数据统计
 * @param data
 * @returns
 */
export const exportGroupChatStatisticsByGroupchat = (data: any) => {
    return request({
        url: '/scrm-api/census/groupchat-stat/groupchat/async-export',
        method: 'POST',
        data
    });
};

/**
 * 按照日期查询客群数据
 * @param data
 * @returns
 */
export const getGroupChatStatisticsByDate = (data: any) => {
    return request({
        url: '/scrm-api/census/groupchat-stat/date/list',
        method: 'POST',
        data
    });
};

/**
 * 按照日期导出客群数据
 * @param data
 * @returns
 */
export const exportGroupChatStatisticsByDate = (data: any) => {
    return request({
        url: '/scrm-api/census/groupchat-stat/date/export',
        method: 'POST',
        data
    });
};

/**
 * 客群统计数据概览
 */
export const getCustomerGroupCensusData = (data: any) => {
    return request({
        url: '/scrm-api/census/customer/group/data',
        method: 'POST',
        data
    });
};

/**
 * 客群统计基础数据
 */
export const getCustomerGroupCensusBasicData = (data: any) => {
    return request({
        url: '/scrm-api/census/customer/group/basic/data',
        method: 'POST',
        data
    });
};

/**
 * 客群统计基础数据折线图
 */
export const getCustomerGroupLineChart = (data: any) => {
    return request({
        url: '/scrm-api/census/customer/group/line/chart',
        method: 'POST',
        data
    });
};
